#define  _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int n = 0;
	scanf("%d", &n);
	char a[14] = { 0 };
	int i = 0;
	int k = 0;
	while (n)
	{
		if (k != 0 && k % 3 == 0)
		{
			a[i++] = ',';
		}
		a[i++] = n % 10 + '0';
		n = n / 10;
		k++;
	}
	for (--i; i >= 0; i--)
	{
		printf("%c", a[i]);
	}

	return 0;
}